<?php

namespace App\Http\Middleware\Pos;

use App\Kuafu\Common\Enum\CommonCodeEnum;
use App\Kuafu\Common\Exceptions\CommonException;
use App\Kuafu\Order\Enum\OrderCodeEnum;
use App\Kuafu\Order\Exceptions\OrderException;
use App\Kuafu\Shop\Enum\CodeEnum;
use App\Kuafu\Shop\Enum\ShopCodeEnum;
use App\Kuafu\Shop\Exceptions\ShopException;
use App\Kuafu\Shop\Service\ShopService;
use Closure;
use Illuminate\Http\Request;


class ShopStatusOrderAuth
{
    /**
     * Check Header Id [shopId, brandId]
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure $next
     * @param string|null ...$guards
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $shopId = $request->header('shopId');

        ShopService::checkShopOrderStatus($shopId);

        return $next($request);
    }
}
